import request from '@/utils/request'

// 查询日常记录-体重记录列表
export function listWeight(query) {
  return request({
    url: '/every/weight/list',
    method: 'get',
    params: query
  })
}

// 查询日常记录-体重记录详细
export function getWeight(id) {
  return request({
    url: '/every/weight/' + id,
    method: 'get'
  })
}

// 新增日常记录-体重记录
export function addWeight(data) {
  return request({
    url: '/every/weight',
    method: 'post',
    data: data
  })
}

// 修改日常记录-体重记录
export function updateWeight(data) {
  return request({
    url: '/every/weight',
    method: 'put',
    data: data
  })
}

// 删除日常记录-体重记录
export function delWeight(id) {
  return request({
    url: '/every/weight/' + id,
    method: 'delete'
  })
}

// 查询体重趋势数据
export function queryWeightTrendList(query) {
  return request({
    url: '/every/weight/trend',
    method: 'get',
    params: query
  })
}

// 查询体重统计异常数据
export function statisticsWeightExce(query) {
  return request({
    url: '/every/weight/statistics',
    method: 'get',
    params: query
  })
}

// 查询体重测量类型列表
export function queryWeightTypeList(query) {
  return request({
    url: '/every/bloodGlucose/targetId',
    method: 'get',
    params: query
  })
}

// 计算当前测量数据，与上一次和10天前的数据对比
export function queryDateCompare(id) {
  return request({
    url: '/every/weight/dateCompare/' + id,
    method: 'get'
  })
}